package cn.cmcc.online.smsapi.ui.model;

import org.json.JSONObject;

public class FlightData {

    protected String flightNumber;
    protected String departAddress;
    protected String arriveAddress;
    protected String departTerminal;
    protected String arriveTerminal;
    protected String departTime;
    protected String arriveTime;
    protected String departDate;
    protected String arriveDate;
    private long receiveTime;

    public FlightData() {

    }

    public FlightData(JSONObject obj) {
        flightNumber = obj.optString("flight_num");
        departAddress = obj.optString("depart_place");
        arriveAddress = obj.optString("arrive_place");
        departTerminal = obj.optString("depart_airport");
        arriveTerminal = obj.optString("arrive_airport");
        departTime = obj.optString("depart_time");
        arriveTime = obj.optString("arrive_time");
        departDate = obj.optString("depart_date");
        arriveDate = obj.optString("arrive_date");
    }

    public void updateJSONObject(JSONObject obj) {
        try {
            obj.put("depart_place", departAddress);
            obj.put("arrive_place", arriveAddress);
            obj.put("depart_airport", departTerminal);
            obj.put("arrive_airport", arriveTerminal);
            obj.put("depart_time", departTime);
            obj.put("arrive_time", arriveTime);
            obj.put("depart_date", departDate);
            obj.put("arrive_date", arriveDate);
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }

    public String getFlightNumber() {
        return flightNumber;
    }

    public String getDepartAddress() {
        return departAddress;
    }

    public String getArriveAddress() {
        return arriveAddress;
    }

    public String getDepartTime() {
        return departTime;
    }

    public String getArriveTime() {
        return arriveTime;
    }

    public String getDepartDate() {
        return departDate;
    }

    public String getArriveDate() {
        return arriveDate;
    }

    public String getDepartTerminal() {
        return departTerminal;
    }

    public String getArriveTerminal() {
        return arriveTerminal;
    }

    public long getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(long receiveTime) {
        this.receiveTime = receiveTime;
    }
}
